package insight.google.game.era.bo.policy.character;

import insight.google.game.era.bo.GameRoom;
import insight.google.game.era.bo.GameUser;
import insight.google.game.era.client.proxy.PlayerClientProxy;
import insight.google.game.era.client.proxy.PlayerClientProxyImpl;
import insight.google.game.era.core.Util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class HuangGaiPolicy extends CharacterPolicy {

    /**
	 * 
	 */
	private PlayerClientProxy playerClientProxy;

	public HuangGaiPolicy(String id, String name){
		super(id, name);
	}
	
	@Override
	public boolean onDiscardExec(GameUser original, GameUser[] targets,
			Map params) {
		// TODO Auto-generated method stub
        playerClientProxy = PlayerClientProxyImpl.getInstance();
        String jsComponenetId = (String)params.get("jsComponenetId");

        playerClientProxy.healLife(original.getScriptProxy(), jsComponenetId, -1);

		int cardCount = 2;
		GameRoom room = Util.getRoom();
		//send card to target user
        room.sendCardToUserByCount(original, cardCount);
//        for(int i=0; i<targets.length; i++){
//            GameUser tagUser = targets[i];
//            room.sendCardToUserByCount(original, cardCount);
//        }
        
		return true;
	}

}
